def print_doc(self):
    print("haha")

class Foo:
    __slots__ = ("name", "age")
    pass

obj1 = Foo()
obj2 = Foo()
# 动态添加实例变量
obj1.name = "jack"
obj2.age = 18
# 动态的给类添加实例方法
Foo.show = print_doc
obj1.show()
obj2.show()

print(obj1.name)
print(obj2.age)

obj2.gender = 'female'